package br.com.ordersys.framework.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class ReflectionUtils {
	public static Class[] addInterfaces(Class clazz, Class... toAdd){
		Set<Class> interfaces = new HashSet<Class>();
		
		while(!clazz.equals(Object.class)){
			for(Class i : clazz.getInterfaces()){
				interfaces.add(i); 
			}
			clazz = clazz.getSuperclass();
		}
		
		if(toAdd != null){
			for(Class i : toAdd){
				interfaces.add(i);
			}
		}
		
		return interfaces.toArray(new Class[0]);
	}

}
